package com.ftg.learn.chapter08.homework01.homework02;

import java.util.Scanner;

/**
 * 学生类
 *
 * @author lijiaxin
 * @version 1.0
 * @date 2023/7/24 10:12
 */

public class Student extends Person{

    private double[] score=new double[5];
    public void luru(){
        Scanner scanner=new Scanner(System.in);
        for (int i = 0; i < 5; i++) {
            score[i]=scanner.nextDouble();
        }
    }

    public void score1(){
        double sum=0;
        for(int i=0;i<5;i++) {
            sum+=score[i];
        }
        double avg=sum/5;
        System.out.println("我的平均成绩为："+avg);
    }
}
